<template>
  <div class="my-header" :style="{ backgroundColor:bgc}">{{title}}</div>
</template>

<script>
export default {
props:{
  bgc:String,
  color:{
    type:String,  //约束 color 类型
    default:"#fff" //不传值 默认白色
  },
  title:{
    type:String,
    requried:true //必传
  }
}
}
</script>

<style lang="less" scoped>
  .my-header {
    height: 45px;
    line-height: 45px;
    text-align: center;
    background-color: #1d7bff;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2;
  }
</style>